import { 
    first,
    timer,
    take
} from 'rxjs'
const FilterOperator = () => {
    console.log("================= 过滤操作符 ====================")

    const source = timer(0,1000).pipe(take(10))
    source.pipe(first()).subscribe(data => console.log(`${data}`))

    return (
        <section style={{padding: '20px'}}>
            <h1>过滤操作符：</h1>
            <p>first</p>
            <p>last</p>
            <p>single</p>
            <p>take</p>
            <p>takeLast</p>
            <p>takeUntil</p>
            <p>takeWhile</p>
            <p>skip</p>
            <p>skipLast</p>
            <p>skipUntil</p>
            <p>skipWhile</p>
            <p>distinct</p>
            <p>distinctUntilChanged</p>
            <p>distinctUntilKeyChanged</p>
            <p>sample</p>
            <p>sampleTime</p>
            <p>auditTime</p>
            <p>debounceTime</p>
            <p>debounce</p>
        </section>
    )
}

export default FilterOperator